public class Ksmm{
	 static String jiami(String m,int k){
	char [] q = m.toCharArray();
	int l =q.length;
	for(int i =0 ;i<l;i++){
		if(q[i]<65||(90<q[i]&&q[i]<97)||q[i]>122){
		System.out.println("Input error");
		break;
		}
		else{
		 	if(65<q[i]&&q[i]<90){
				if((int)q[i]+k>90){
				(int)q[i]=(int)q[i]+k-90+65-1;
				}
				else{
				(int)q[i]=(int)q[i]+k;
				}
			}
			else if(97<q[i]&&q[i]<122){
				if((int)q[i]+k>122){
				(int)q[i]=(int)q[i]+k-122+97-1;
				}
				else{
				(int)q[i]=(int)q[i]+k;
				}
			}
		}
	}
	q=(char)q;
	return new String(q);
	}
	static String jiemi(String c,int k){
	char [] q = c.toCharArray();
	int l =q.length;
	for(int i =0 ;i<l;i++){
		if(q[i]<65||(90<q[i]&&q[i]<97)||q[i]>122){
		System.out.println("Input error");
		break;
		}
		else{
		 	if(65<q[i]&&q[i]<90){
				if((int)q[i]-k<65){
				(int)q[i]=90-(65-((int)q[i]-k))+1;
				}
				else{
				(int)q[i]=(int)q[i]-k;
				}
			}
			else if(97<q[i]&&q[i]<122){
				if((int)q[i]-k<97){
				(int)q[i]=122-(97-((int)q[i]-k))+1;
				}
				else{
				(int)q[i]=(int)q[i]-k;
				}
			}
		}
	}
	q=(char)q;
	return new String(q);
	}
}
	
